package com.matrix.java.chap_18;

public class Ex18_14 {
    public static void main(String[] args) {
        System.out.println(count("AA133S"));
    }

    public static int count(String str) {
        return count(str, str.length() - 1);
    }

    public static int count(String str, int length) {
        int count = 0;
        if (length>=0) {
            count = count(str.substring(0, length), length - 1) +
                    (str.charAt(length) >= 65 && str.charAt(length) < 97 ? 1 : 0);
        }
        return count;
    }
}
